<extend name="Public:template" />
<block name="page_header">
	<include file="Public:header_cust"/>
</block>
<block name="page_body">
	<div class="row">
		<div class="span4">
			<include file="Public:left_menu_cust"/>
		</div>
		<div class="span16">
			<include file="Public:breadcrumb_cust"/>
		</div>
		
		<empty name='Think.session.SES_CUST_ID'>
			<div class="span16">
				<div class="alert alert-danger text-center">
					尊敬的客户您好，您还没有登录！
				</div>
				<div class="text-center">
					<a href="{:U('CustPassport/index')}" class="btn btn-warning"  id="loginStatus">立即登录</a>
					<a href="{:U('CustPassport/showRegist')}" class="btn btn-success"  id="loginStatus">马上注册</a>
				</div>
			</div>
		<else/>
			<div class="span16">
				<div class="alert alert-success">
					欢迎光临利客送社区连锁超市!
				</div>
				<notempty name="cust.cartItemCnt">
					<span class="btn alert-success" style="border-radius:0;border-bottom:0"><span class="icon-shopping-cart"></span>当前您有{$cust.cartItemCnt}种商品还在购物车中</span>
					<table class="table table-bordered">
						<tr>
							<td><button type="button" class="btn btn-warning pull-left" onclick="showCart()">立即查看购物车</button></td>
						</tr>
					</table>
				</notempty>
				<notempty name="cust.orderList">
				<span class="btn alert-success" style="border-radius:0;border-bottom:0"><span class="icon-time"></span>当前您有{$cust.orderList|count}个正在进行中的订单</span>
				<table class="table table-bordered">
					<tr>
						<th>订单号</th>
						<th>下单时间</th>
						<th>订单总额</th>
						<th>订单状态</th>
						<th>操作</th>
					</tr>
					<volist name="cust.orderList" id="val">
						<tr>
							<td class="span4"><a href="{:U('CustOrder/showDetail',array('order_code'=>$val['order_code']))}"><span class="badge alert-danger">{$val.order_type|m_order_type}</span>{$val.order_code}</a></td>
							<td class="span4">{$val.cust_order_time|date="Y-m-d H:i",###}</td>
							<td class="span4 text-right">
								¥{$val.order_amt|number_format=###, 2,'.',''}
								<if condition="$val['order_send_fee'] neq 0">
									(含¥{$val['order_send_fee']|number_format=###, 2,'.',''}运费)
								<else/>
									(免运费)
								</if>
							</td>
							<td class="span3">{$val.order_status|m_order_status}</td>
							<td><a href="{:U('CustOrder/showDetail',array('order_code'=>$val['order_code']))}">详细</a></td>
						</tr>
					</volist>
				</table>	
				</notempty>		
			</div>
		</empty>
	</div>
</block>
<block name="script_footer">
<script type="text/javascript">
$(document).ready(function(){

})
</script>
</block>